<!DOCTYPE html>
<!-- ng-app -->
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="../../../js/plugins/angular/angular.min.js" type="text/javascript"></script>
</head>
<body>
    <form name="temp_form" ng-submit="save()" ng-controller="cont">
        <div>
            <input type="text" name="t_name" ng-model="name" required>
            <span ng-show="temp_form.t_name.$error.required">姓名不能为空！</span>
        </div>
        <div>
            <input type="text" name="t_email" ng-model="email" required>
            <span ng-show="temp_form.t_email.$error.required">邮箱不能为空！</span>
            <span ng-show="temp_form.t_email.$error.email">格式不对！</span>
        </div>
        <input type="submit" ng-disabled="temp_form.$invalid" value="提交">
    </form>

    <script>
        var app = angular.module('app',[]);
        app.controller('cont',['$scope',function ($scope) {
            $scope.name = 'oli';
            $scope.email = 'oli@qq.com';
            $scope.save = function () {
                alert('提交成功');
            }
        }])

    </script>
</body>
</html>